<form id="pagerForm" method="post" action="{:U($module_name.'/'.$action_name."?model=".$model)}">
    <input type="hidden" name="pageNum" value="{$pageNum}" />
    <input type="hidden" name="numPerPage" value="{$numPerPage}" />
    <input type="hidden" name="orderField" value="{$orderField}" />
    <input type="hidden" name="orderDirection" value="{$orderDirection}" />
</form>
<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="{:U($module_name.'/'.$action_name)}" method="post">
        <div class="searchBar">
            <ul class="searchContent">
                <li style="width:200px;">
                <label style="width: 50px;">关键字：</label>
                <input type="text" name="keywords" value="{$keywords}"/>
                </li>
                <li style="width: 100px;">
                <select class="combox" name="sfield">
                	<option value="all" >全部</option>
                    <option value="userid" >用户ID</option>				     
                </select>
				<input type="hidden" name="sfield_name" value="userid" />					
				
                </li>
				
				<li style="width:160px;">
						<select name='status'>
							<option value=''>状态</option>
							<option value='1' {if $conditon['status']==1}selected='selected'{/if}>已使用</option>
							<option value='3' {if $conditon['status']==3}selected='selected'{/if}>未使用</option>
							<option value='2' {if $conditon['status']==2}selected='selected'{/if}>已过期</option>
						</select>
					 </li>
					<li style="width:160px;">
						<input name="stime" class="date" type="text" value="{$conditon['starttime']}"/><a class="inputDateButton" href="javascript:;">选择</a>
					  </li>
					<li style="width:160px;">
						<input name="etime" class="date" type="text" value="{$conditon['endtime']}"/><a class="inputDateButton" href="javascript:;">选择</a>
					</li>				
				<!--	
				<li>
					状态：
					<select name="status">
						<option value='1' selected>进行中</option>
						<option value='0'>已结束</option>
					</select>
				</li>
				-->
                <li style="padding-top:0;"><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">	
			<li><a class="add" href="{:U('Money/addcoupon')}" target="dialog" width="750" height="550" title="添加优惠券"  ><span>添加优惠券</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>		
				<th width="30">ID</th>
				<th width="60" orderField="userid" {if $orderField=='userid'}class="{$orderDirection}"{/if}>赠送用户</th>		
				<th width="100" orderField="value" {if $orderField=='value'}class="{$orderDirection}"{/if}>面值：[ <font color='red'>{$sum}</font> ]</th>			
				<th width="60" orderField="point" {if $orderField=='point'}class="{$orderDirection}"{/if}>消耗积分</th>
				<th width="120" orderField="createtime" {if $orderField=='createtime'}class="{$orderDirection}"{/if}>创建时间</th>
				<th width="120" orderField="starttime" {if $orderField=='starttime'}class="{$orderDirection}"{/if}>开始日期</th>
				<th width="120" orderField="endtime" {if $orderField=='endtime'}class="{$orderDirection}"{/if}>结束日期</th>
				<th width="60" orderField="status" {if $orderField=='status'}class="{$orderDirection}"{/if}>状态</th>
				<th width="150" orderField="order_sn" {if $orderField=='order_sn'}class="{$orderDirection}"{/if}>使用的订单号</th>
				<th width="120" orderField="usetime" {if $orderField=='usetime'}class="{$orderDirection}"{/if}>使用时间</th>
				<th width="60">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr target="sid_user" rel="9" style="height:40px;">		
				<td>{$vo['id']}</td>	
				<td>{$vo.userid} |  <a title="查看" target="dialog" width="580" height="500" rel="User_detail_{$vo['id']}" href="{:U('User/detail',array('id'=>$vo['userid']))}">{$vo.username}</a></td>		
				<td width=';'><font color='red'>{$vo['value']/100}</font></td>				
				<td>{$vo['point']/100}</td>
				<td>{if $vo['createtime']}{$vo.createtime|date='Y-m-d H:i:s',###}{/if}</td>
				<td width=';'>{if $vo['starttime']}{$vo.starttime|date='Y-m-d H:i:s',###}{else}不限制{/if}</td>
				<td>{if $vo['endtime']}{$vo.endtime|date='Y-m-d H:i:s',###}{else}不限制{/if}</td>

				<td>{if $vo['status']==0}<font color='green'>未使用</font>{elseif $vo['status']==1}已使用{elseif $vo['status']==2}已过期{/if}</td>
				<td>{$vo.order_sn}</td>
				<td>{if $vo['usetime']}{$vo.usetime|date='Y-m-d H:i:s',###}{/if}</td>
				
					<td>
					{if $vo['status']==0}
					<a class="btnDel" href="{:U('Money/delcoupon',array('id'=>$vo['id']))}" target="ajaxTodo" title="确定删除？">删除</a>
					{/if}
					
				</td>
			</tr>
			</volist>
		</tbody>
	</table>
	<include file="Index:pages" />
</div>
<script type="text/javascript">
function set_param(obj, id, type, model){
	var obj = $(obj).prev();
	$.ajax({
		type: "POST",
		url: "{:U('Product/set_param')}",
		data: 'id='+id+'&type='+type+'&value='+obj.val()+'&model='+model,
		dataType:'json',
		success: function(msg){
			alertMsg.info('修改成功！');
			if ( type == 'image' )
				if ( obj.val() ) obj.val(0);
				else obj.val(1);
		}
	});
}

$(function(){
	
});
</script>
